<template>
    <div>
<h3>权益添加</h3>
<table class="table table-bordered">
    <tbody>
        <tr>
            <td>权益名称</td>
            <td><input type="text" v-model="a.RightName"></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="button" value="增加" @click="ok"></td>
        </tr>
    </tbody>
</table>

    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import moment from 'moment';
const router = useRouter();
const route = useRoute();

let a:any=reactive({
    RightName:'',

})

const ok:any=()=>{
    axios({
        url:'/api/Right/RightAdd',
        method:'post',
        data:a
    })
    .then((res)=>{
        if(res.data==-1)
        {
            alert("重复");
            return;
        }
        if(res.data>0)
        {
            alert("成功");
            router.push("/rightlist")
        }
    })
}


</script>

<style scoped>

</style>